const http = require('http');

http.createServer((req, res) => {
  console.log(req.method, req.url);

  req.on('data', (data) => {
    console.log(data.toString());
  })

  res.write('hello welcome');
  res.end();
}).listen(3000, () => {
  console.log('已成功连接至服务器，请访问localhost:3000');
})